<ion-view >
    <ion-nav-title>{{prodInfo.prod_name | defString }}</ion-nav-title>
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-content ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>
        <div style="padding-bottom:15px"></div>
        <!-- panel -->
        <div class="panel income">
            <dl>
                <dt><i class="icon_calendar"></i>{{param.prevDate}}收益</dt>
                <dd>{{(holdFund.current_amount/10000)*prodInfo.prod_gain | defNumber: 2 }}</dd>
            </dl>
            <ul class="income-items clearfix">
                <li><em class="inc">{{holdFund.total_income | defNumber: 2 }}<sub>元</sub></em>累计收益</li>
                <li><em class="{{holdFund.rate < 0 ? 'inc_': 'inc'}}">{{ holdFund.rate | defNumber:2 }}<sub>%</sub></em>参考收益率</li>
            </ul>
            <time class="item time" ng-if="short_term_fund.length > 0 && prodInfo.prod_status != 5">
                <i class="icon_date" ></i>
                <i class="icon_more" ng-click="shortDetail()" ng-if="short_term_fund.length > 1"></i>
                可卖时间：{{short_term_fund[0].redeem_end_date}}
                {{param.pay_account_empty ? " 9:00-15:00" : " 当日15:00前"}}
            </time>
            <time class="item time" ng-if="prodInfo.prod_status == 5">
                <i class="icon_date"></i>目前处于封闭期，封闭期结束后可开放卖出
            </time>
        </div>
        <div class="little-tip">显示收益未完全扣除手续费，实际收益以基金公司实际到账金额为准。</div>
        <!-- panel -->
        <div class="panel basic-info">
            <ul>
                <li>基金金额：<em>{{ holdFund.market_value | defNumber:2 }}元</em></li>
                <li>万份收益：<em class="inc">{{ prodInfo.prod_gain | defNumber: 4 }}元</em></li>
                <li>基金份额：<em>{{holdFund.current_amount | defNumber :2 }}</em></li>
                <li>可卖出份额：<em>{{param.enable_amount | defNumber:2 }}</em></li>
                <li>最新七日年化：<em class="inc">{{prodInfo.prod_yield | defNumber :4:'%'}}</em></li>
            </ul>
        </div>
        <div class="panel">
            <div class="item group"><a href="#/tab/account-productOrderHistory?prodCode={{prodInfo.prod_code}}&prodSource={{prodInfo.prod_source}}&trans_account={{holdFund.trans_account}}">历史交易记录</a></div>
        </div>
        <div class="panel">
            <div class="item group"><a href="#/{{prodInfo.url}}/{{prodInfo.prod_code}}">产品主页</a></div>
        </div>
    </ion-content>

    <ion-footer-bar class="footer">
        <dl>
            <dt></dt>
            <dd>
                <a ng-if="prodInfo.prod_status == 0 || prodInfo.prod_status == 3 || prodInfo.prod_status == 4 " class="btn"
                   buy-button prod_code="{{param.prodCode}}" prod_source="{{param.prodSource}}" add="1">追加购买</a>
                <a ng-if="prodInfo.prod_status == 2" class="btn disable">暂停申购</a>

                <a ng-if="param.enableSell && (prodInfo.prod_status == 0 || prodInfo.prod_status == 2)"
                   sell-button allot_no="{{param.allotNo}}" prod_code="{{param.prodCode}}" prod_source="{{param.prodSource}}"
                   class="btn sell">卖出</a>
                <a ng-if="!param.enableSell && (prodInfo.prod_status == 0 || prodInfo.prod_status == 2)" class="btn sell disable">卖出</a>
                <a ng-if="prodInfo.prod_status == 5" class="btn disable">封闭期</a>
                <a ng-if="prodInfo.prod_status== 1" class="btn disable">暂停交易</a>
            </dd>
        </dl>
    </ion-footer-bar>

</ion-view>
